package cn.kuaipan.android.openapi.tasks;


import com.easyfun.healthmagicbox.comm.HealthThreadPool;

public abstract class MyAsyncTask <RequestT, MidT, ResultT> implements  Runnable {
	
	RequestT mrequest;
	public void execute(RequestT request)
	{
		mrequest = request;
		HealthThreadPool.getInstance().execute(this);
	}
	
	public void run() {
		onPreExecute();
		ResultT result = doInBackground(mrequest);
		onPostExecute(result);
	}
	
	abstract protected void onPreExecute() ;
	abstract protected ResultT doInBackground(RequestT params) ;

	abstract protected void onPostExecute(ResultT result) ;
}
